<template>
	<view class="page">
		<!-- 导航栏 -->
		<view class="navbar">
			<view class="navbar-content">
				<view class="back-button" @click="goBack">
					<uni-icons type="back" size="30" color="#ffff"></uni-icons>
				</view>
				<text class="navbar-title">选择车辆</text>
			</view>
		</view>
		
		<!-- 蓝色背景区域 -->
		<view class="blue-background"></view>
		
		<!-- 主内容容器 -->
		<view class="main-content">
			<!-- 车辆列表 -->
			<view class="vehicle-list">
				<!-- 车辆1 -->
				<view class="vehicle-card" :class="{ 'selected': selectedVehicle === 1 }" @click="selectVehicle(1)">
					<image class="vehicle-image" src="/static/车.jpg" mode="aspectFill"></image>
					<view class="vehicle-info">
						<text class="vehicle-model">车型: 奔驰-GR</text>
						<text class="vehicle-plate">车牌: 豫M35468</text>
					</view>
					<view class="select-icon" :class="{ 'selected': selectedVehicle === 1 }">
						<image v-if="selectedVehicle === 1" class="checkmark-icon" src="/static/车联网服务-01专业洗车-07洗车-选择车辆_slices/组 5 拷贝.png" mode="aspectFit"></image>
						<image v-else class="unselected-icon" src="/static/车联网服务-01专业洗车-07洗车-选择车辆_slices/椭圆 4 拷贝 2.png" mode="aspectFit"></image>
					</view>
				</view>
				
				<!-- 车辆2 -->
				<view class="vehicle-card" :class="{ 'selected': selectedVehicle === 2 }" @click="selectVehicle(2)">
					<image class="vehicle-image" src="/static/车.jpg" mode="aspectFill"></image>
					<view class="vehicle-info">
						<text class="vehicle-model">车型: 奔驰-GR</text>
						<text class="vehicle-plate">车牌: 豫M35468</text>
					</view>
					<view class="select-icon" :class="{ 'selected': selectedVehicle === 2 }">
						<image v-if="selectedVehicle === 2" class="checkmark-icon" src="/static/车联网服务-01专业洗车-07洗车-选择车辆_slices/组 5 拷贝.png" mode="aspectFit"></image>
						<image v-else class="unselected-icon" src="/static/车联网服务-01专业洗车-07洗车-选择车辆_slices/椭圆 4 拷贝 2.png" mode="aspectFit"></image>
					</view>
				</view>
			</view>
		</view>
		
		<!-- 底部添加车辆按钮 -->
		<view class="bottom-container">
			<view class="add-vehicle-btn">
				<image class="btn-bg" src="/static/车联网服务-01专业洗车-07洗车-选择车辆_slices/矩形 10.png" mode="aspectFill"></image>
				<text class="plus-icon">+</text>
				<text class="btn-text">添加车辆</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				selectedVehicle: 1
			}
		},
		methods: {
			goBack() {
				uni.navigateBack();
			},
			selectVehicle(index) {
				this.selectedVehicle = index;
			}
		}
	}
</script>

<style>
	.page {
		background-color: #f5f6fa;
		min-height: 100vh;
		position: relative;
		padding-bottom: 120rpx;
	}
	
	/* 导航栏 */
	.navbar {
		width: 100%;
		height: 88rpx;
		background: linear-gradient(120deg, #1f78ff 0%, #2f89ff 100%);
		display: flex;
		align-items: center;
		justify-content: center;
	}
	
	.navbar-content {
		width: 100%;
		height: 100%;
		display: flex;
		align-items: center;
		position: relative;
		padding: 0 24rpx;
	}
	
	.back-button {
		position: absolute;
		left: 24rpx;
		width: 60rpx;
		height: 60rpx;
		display: flex;
		align-items: center;
		justify-content: center;
	}
	
	.navbar-title {
		color: #ffffff;
		font-size: 32rpx;
		font-weight: 600;
		text-align: center;
		width: 100%;
	}
	
	/* 蓝色背景区域 */
	.blue-background {
		position: absolute;
		top: 88rpx;
		left: 0;
		width: 100%;
		height: 200rpx;
		background: linear-gradient(120deg, #1f78ff 0%, #2f89ff 100%);
	}
	
	/* 主内容容器 */
	.main-content {
		position: absolute;
		top: 100rpx;
		left: 50%;
		transform: translateX(-50%);
		width: 94%;
		max-width: 750rpx;
		z-index: 10;
		padding: 20rpx 0;
	}
	
	/* 车辆列表 */
	.vehicle-list {
		display: flex;
		flex-direction: column;
		gap: 20rpx;
	}
	
	/* 车辆卡片 */
	.vehicle-card {
		background: #ffffff;
		border-radius: 16rpx;
		padding: 30rpx;
		display: flex;
		align-items: center;
		box-shadow: 0 2rpx 10rpx rgba(0,0,0,0.1);
		position: relative;
	}
	
	.vehicle-card.selected {
		border: 2rpx solid #1f78ff;
	}
	
	.vehicle-image {
		width: 120rpx;
		height: 120rpx;
		border-radius: 50%;
		margin-right: 30rpx;
	}
	
	.vehicle-info {
		flex: 1;
		display: flex;
		flex-direction: column;
		gap: 10rpx;
	}
	
	.vehicle-model {
		color: #333333;
		font-size: 32rpx;
		font-weight: 600;
	}
	
	.vehicle-plate {
		color: #666666;
		font-size: 28rpx;
	}
	
	.select-icon {
		width: 40rpx;
		height: 40rpx;
		display: flex;
		align-items: center;
		justify-content: center;
	}
	
	.checkmark-icon {
		width: 40rpx;
		height: 40rpx;
	}
	
	.unselected-icon {
		width: 40rpx;
		height: 40rpx;
	}
	
	/* 底部容器 */
	.bottom-container {
		position: fixed;
		bottom: 0;
		left: 0;
		width: 100%;
		padding: 20rpx 30rpx;
		background: #ffffff;
		z-index: 20;
	}
	
	/* 底部添加车辆按钮 */
	.add-vehicle-btn {
		position: relative;
		width: 89%;
		height: 70rpx;
		border-radius: 40rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 10rpx;
		overflow: hidden;
	}
	
	.btn-bg {
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		z-index: 1;
	}
	
	.plus-icon {
		color: #ffffff;
		font-size: 36rpx;
		font-weight: 600;
		position: relative;
		z-index: 2;
	}
	
	.btn-text {
		color: #ffffff;
		font-size: 28rpx;
		position: relative;
		z-index: 2;
	}
</style>




